<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStaffsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('staffs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('store_id')->index()->comment('门店id');
            $table->string('staff_no', '16')->index()->comment('员工工号');
            $table->integer('department_id')->index()->comment('所属部门');
            $table->string('name', '50')->index()->comment('名称');
            $table->string('picture')->nullable()->comment('证件照片');
            $table->string('register_steel')->nullable()->comment('入职表');
            $table->string('id_card')->nullable()->comment('身份证');
            $table->string('health_card')->nullable()->comment('健康证');
            $table->string('job_card')->nullable()->comment('特种工作证');
            $table->integer('salary')->default(0)->comment('薪水');
            $table->integer('status')->default(1)->comment('在职状态:1在职 2离职');
            
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('statffs');
    }
}
